namespace Cos.Core.NHibernate.Mapping
{
    #region Usings

    using FluentNHibernate.Mapping;

    #endregion

    public class FormMap : ClassMap<FormDataModel>
    {
        #region Constructors and Destructors

        public FormMap()
        {
            this.Table("Form");
            this.LazyLoad();
            this.Id(x => x.Id).GeneratedBy.Native().Column("ID");
            this.Map(x => x.Name).Not.Nullable().Column("Name");
            this.Map(x => x.CreationDate).Not.Nullable().Column("Creation_Date");
            this.Map(x => x.LastModifiedDate).Not.Nullable().Column("Last_Modified_Date");
            this.Map(x => x.ApprobationDate).Nullable().Column("Approbation_Date");
            this.Map(x => x.Author).Not.Nullable().Column("Author");
            this.Map(x => x.IsDeleted).Not.Nullable().Column("Is_Deleted");
            this.Map(x => x.DisplayType).Not.Nullable().Column("Display_Type");
            this.Map(x => x.CSS).Column("CSS");
            this.Map(x => x.ShowSummary).Not.Nullable().Column("Show_Summary");
            this.Map(x => x.EmailFrom).Column("Email_From");
            this.Map(x => x.ConfirmEmail).Column("Confirm_Email");
            this.Map(x => x.Kickback).Column("Kickback");
            this.Map(x => x.ReturnUrl).Column("Return_URL");
            this.Map(x => x.PageCss).Column("Page_CSS");
            this.Map(x => x.SelectedPageCss).Column("Selected_Page_CSS");
            this.Map(x => x.ShowAsSurvey).Not.Nullable().Column("Show_As_Survey");
            this.Map(x => x.AnswerOnce).Not.Nullable().Column("AnswerOnce");
            //HasMany(x => x.FormCultures).KeyColumn("Form_ID");
            //HasMany(x => x.FormElements).KeyColumn("Form_ID");
            //HasMany(x => x.FormPages).KeyColumn("Form_ID");
        }

        #endregion
    }
}